
/*! Create by qkl QQ:276116565 - 2015-02-04 20:34:31 */
$(function () {
    var a = new ZeroClipboard($(".copywx"));
    var d = UE.getEditor("editor", {
        topOffset: 0,
        autoFloatEnabled: !1,
        autoHeightEnabled: !1,
        autotypeset: {
            removeEmptyline: !0
        },
        toolbars: [
            ["source", "undo", "redo", "bold", "italic", "underline", "forecolor", "backcolor", "link", "unlink", "paragraph", "fontfamily", "fontsize", ],
            ["indent", "justifyleft", "justifyright", "justifycenter", "justifyjustify", "rowspacingtop", "rowspacingbottom", "lineheight", "edittip ", "inserttable", 'insertimage', 'background', "template", 'drafts', "emotion", "map", "insertvideo", "spechars", "searchreplace", "removeformat", "autotypeset", ]
        ],
        autoHeightEnabled: false,
        allowDivTransToP: false,
        autoFloatEnabled: false,
        enableAutoSave: true
    });


    d.ready(function () {
        a.on("copy", function (a) {
                var b = a.clipboardData;
                b.setData("text/html", d.getContent()),
                    alert("恭喜成功复制！在微信公众平台粘贴即可！")
            }),
            d.addListener("contentChange", function () {
                $("#preview").html(d.getContent())
            }), $(".itembox").on("click", function () {
                d.execCommand("insertHtml", '<section class="unieditor">' + $(this).html() + "</section><br />")
            })
    }), $(".tabs li a").on("click", function () {
        $(this).addClass("current").parent().siblings().each(function () {
            $(this).find("a").removeClass("current")
        }), $("#" + $(this).attr("tab")).show().siblings().hide()
    }), $(".itembox img,.itembox audio").each(function () {
        var a = $(this);
        a.attr("src", a.data("src"))
    })
});


var current_active_v3item = null;
ZeroClipboard.config({
    swfPath: "ueditor/third-party/zeroclipboard/ZeroClipboard.swf"
});
var client = new ZeroClipboard($('.copy-editor-html'));
$(function () {
    $(window).resize(function () {
        var win_height = $(window).height();

        // $('#editor,.edui-editor-iframeholder').height(area_height - 16);
        // $('#styleselect').height(area_height);
        // $('.content').height(area_height - 110);
    }).trigger('resize');

});